package com.heima.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.github.pagehelper.PageInfo;
import com.heima.pojo.*;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface UserMapper extends BaseMapper<User> {

   

    @Insert("insert into tb_sku_class (class_name) values (#{goodsName}) ")
    int addGoodsClass(String goodsName);

    List<UserPojo> selectUserList(UserQueryParam user);
    @Select("select * from tb_role ")
    List<Role> selectRoleList();
    @Select("select * from tb_user where user_name = #{userName}")
    User selectUserInfo(UserPojo user);
    @Insert("insert into tb_user  ( role_id, user_name, login_name, password, secret, role_code, mobile, region_id, region_name, status, image) " +
            "values (#{roleId},#{userName},#{loginName},#{password},#{secret},#{roleCode},#{mobile},#{regionId},#{regionName},#{status},#{image}) ")
    void insertUser(UserPojo user);

    int updateUser(UserPojo user);

    @Delete("delete  from tb_user where id = #{userId}")
    int deleteByUserId(int userId);
}
